import {getRequest, postRequest} from '../baseRequest'
import request from '@/api/index'
// 创建问卷
export const createFormRequest = (data) => postRequest('/user/form/create', data)
// 修改问卷
export const updateFormRequest = (data) => postRequest('/user/form/update', data)
// 获取项目详情
export const getProjectRequest = (formKey) => getRequest(`/user/form/${formKey}`)
//恢复问卷
export const restoreRecycleFormRequest = (data) => postRequest('/user/form/recycle/restore', data)
// 从回收站删除问卷
export const deleteRecycleFormRequest = (data) => postRequest('/user/form/recycle/delete', data)
// 查询回收站问卷
export const listRecycleFormRequest = (data) => getRequest('/user/form/recycle/page', data)
// 逻辑删除问卷
export const logicDeleteFormRequest = (data) => postRequest('/user/form/logic/delete', data)
// 删除问卷
export const deleteFormRequest = (data) => postRequest('/user/form/delete', data)


// 停止收集问卷
export const stopFormRequest = (data) => postRequest('/user/form/stop', data)

// 查询问卷分页
export const pageFormRequest = (params) => getRequest('/user/form/page', params)

// 查询问卷项内容
export const listProjectItemRequest = (params) => getRequest('/user/form/item/list', params)

// 查询问卷项内容
export const listFormFieldsRequest = (formKey) => getRequest(`/user/form/fields/${formKey}`)

// 查询固定问卷项内容
export const listFixedFormFieldsRequest = (formKey) => getRequest(`/user/form/fixed/fields/${formKey}`)

// 查询问卷逻辑列表
export const getFormLogicRequest = (params) => getRequest('/user/form/logic', params)

// 保存问卷逻辑
export const saveFormLogicRequest = (data) => postRequest('/user/form/logic/save', data)

// 查询主题列表
export const listThemeRequest = (params) => getRequest('/form/theme/list', params)

// 保存问卷选中主题
export const saveUserThemeRequest = (data) => postRequest('/user/form/theme/save', data)

// 查询问卷主题
export const getUserThemeRequest = (projectKey) => getRequest(`/user/form/theme/${projectKey}`)

// 查询问卷文件夹树
export const getUserFormFolderTreeRequest = () => getRequest(`user/form/folderTree`)

// 我协作的问卷
export const getMyCooperationFormsRequest = (params) => getRequest(`user/form/my/cooperation`, params)
// 导出
export function exportAllSample(data) {
    return request({
        url: `/user/form/exportFormData`,
        method: 'post',
        timeout: 3600000,
        responseType: 'blob',
        params:data
    })
  }
  
  

